//
//  LeftMenuViewController.m
//  TT
//
//  Created by lanou3g on 16/3/10.
//  Copyright © 2016年 Super磊. All rights reserved.
//

#import "LeftMenuViewController.h"
#import "TTViewController.h"
#import "MessageViewController.h"
#import "professViewController.h"
#import "setViewController.h"
#import "guideViewController.h"
#import "recommendViewController.h"
#import "mimiViewController.h"
#import "AppDelegate.h"
#import <EaseMob.h>
@interface LeftMenuViewController ()

@end

@implementation LeftMenuViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
//    self.view.backgroundColor =[UIColor greenColor];
    
    UIImageView *imV =[[UIImageView alloc]initWithFrame:CGRectMake(50, 100, 100, 100)];
    imV.layer.cornerRadius =50;
    imV.layer.masksToBounds =YES;
    imV.backgroundColor =[UIColor orangeColor];
    
    UILabel *lable =[[UILabel alloc]initWithFrame:CGRectMake(50, 210, 200, 30)];
    lable.backgroundColor =[UIColor cyanColor];
    UILabel *lable2 =[[UILabel alloc]initWithFrame:CGRectMake(50, 250, 200, 30)];
    lable2.text =@"点击查看/编辑";
    lable2.textColor =[UIColor grayColor];
    [self.view addSubview:imV];
    [self.view addSubview:lable];
    [self.view addSubview:lable2];
    
    self.tap =[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(tapAction)];
    [imV addGestureRecognizer:self.tap];
    //打开用户交互
    imV.userInteractionEnabled =YES;
    
   
    UIButton *tt = [UIButton buttonWithType:(UIButtonTypeSystem)];
    tt.frame = CGRectMake(50, 300, 100, 50);
    [tt setTitle:@"探探" forState:(UIControlStateNormal)];
    [tt addTarget:self action:@selector(ttAction) forControlEvents:(UIControlEventTouchUpInside)];
    [self.view addSubview:tt];
    
        UIButton *message = [UIButton buttonWithType:(UIButtonTypeSystem)];
    message.frame = CGRectMake(50, 350, 100, 50);
    [message setTitle:@"消息" forState:(UIControlStateNormal)];
    [message addTarget:self action:@selector(messageAction) forControlEvents:(UIControlEventTouchUpInside)];
    [self.view addSubview:message];

    UIButton *profess = [UIButton buttonWithType:(UIButtonTypeSystem)];
    profess.frame = CGRectMake(50, 400, 100, 50);
    [profess setTitle:@"匿名暗恋表白" forState:(UIControlStateNormal)];
    [profess addTarget:self action:@selector(professAction) forControlEvents:(UIControlEventTouchUpInside)];
    [self.view addSubview:profess];
    
    
    UIButton *set = [UIButton buttonWithType:(UIButtonTypeSystem)];
    set.frame = CGRectMake(50, 450, 100, 50);
    [set setTitle:@"设置" forState:(UIControlStateNormal)];
    [set addTarget:self action:@selector(setAction) forControlEvents:(UIControlEventTouchUpInside)];
    [self.view addSubview:set];
    
    UIButton *guide = [UIButton buttonWithType:(UIButtonTypeSystem)];
    guide.frame = CGRectMake(50, 500, 100, 50);
    [guide setTitle:@"新手引导" forState:(UIControlStateNormal)];
    [guide addTarget:self action:@selector(guideAction) forControlEvents:(UIControlEventTouchUpInside)];
    [self.view addSubview:guide];
    
    UIButton *recommend = [UIButton buttonWithType:(UIButtonTypeSystem)];
    recommend.frame = CGRectMake(50, 550, 100, 50);
    [recommend setTitle:@"推荐给好友" forState:(UIControlStateNormal)];
    [recommend addTarget:self action:@selector(recommendAction) forControlEvents:(UIControlEventTouchUpInside)];
    [self.view addSubview:recommend];
    
    
}
-(void)tapAction {

    mimiViewController *mimi =[[mimiViewController alloc]init];
    //模态跳转
    [self presentViewController:mimi animated:YES completion:nil];

}


-(void)ttAction {
    TTViewController *tt =[TTViewController new];
    UINavigationController *tt_na =[[UINavigationController alloc]initWithRootViewController:tt];
    NSUserDefaults *user = [NSUserDefaults standardUserDefaults];
    tt.mobilePhoneNumber = [user valueForKey:@"mobilePhoneNumber"];
    AppDelegate *app =[UIApplication sharedApplication].delegate;
    [app.draw setRootViewController:tt_na];

}

-(void)messageAction {

    AppDelegate *app =[UIApplication sharedApplication].delegate;
    [app.draw showRightViewController:nil];


    
}

    


-(void)professAction {
    professViewController *progess =[[professViewController alloc]init];
    UINavigationController *progress_na =[[UINavigationController alloc]initWithRootViewController:progess];
    AppDelegate *app =[UIApplication sharedApplication].delegate;
    [app.draw setRootViewController:progress_na];
    
}
-(void)setAction {
    setViewController *set =[[setViewController alloc]init];
    UINavigationController *set_na =[[UINavigationController alloc]initWithRootViewController:set];
    AppDelegate *app =[UIApplication sharedApplication].delegate;
    [app.draw setRootViewController:set_na];
    
}
-(void)guideAction {
    guideViewController *guide =[[guideViewController alloc]init];
    UINavigationController *guide_na =[[UINavigationController alloc]initWithRootViewController:guide];
    AppDelegate *app =[UIApplication sharedApplication].delegate;
    [app.draw setRootViewController:guide_na];
}
-(void)recommendAction {
    recommendViewController *recommend =[[recommendViewController alloc]init];
    UINavigationController *recommend_na =[[UINavigationController alloc]initWithRootViewController:recommend];
    AppDelegate *app =[UIApplication sharedApplication].delegate;
    [app.draw setRootViewController:recommend_na];

}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
